home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_item_poisonkit.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  121 lines

  1. # Jones 3D Cog Script
  2. #
  3. # item_PoisonKit.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message    activated
  14. message    touched
  15. message    taken
  16. message    user0
  17.  
  18. cog        talkCog                    local
  19.  
  20. sound    foundSnd=INXJ157.wav    local
  21.  
  22. thing    player                    local
  23.  
  24. int        bin=46                    local
  25.  
  26. int        bUnderwater                local
  27.  
  28. end
  29.  
  30. # ===================================================================
  31.  
  32. code
  33.  
  34. activated:
  35.  
  36.     player = GetSourceRef();
  37.     bUnderwater = BitTest(GetThingFlags(player), 0x02000000);
  38.  
  39.     StartCutscene(0);
  40.  
  41.     if (!bUnderwater)
  42.     {
  43.         talkCog = GetCogByIndex(0);
  44.         SendMessage(talkCog, 27);
  45.     }
  46.  
  47.     if (Rand() < 0.5)
  48.     {
  49.         SetExtCamOffset('0.15 -0.05 0.04');
  50.     }
  51.     else
  52.     {
  53.         SetExtCamOffset('-0.15 -0.05 0.04');
  54.     }
  55.     SetExtCamLookOffset('0.0 0.02 -0.01');
  56.  
  57.     return;
  58.  
  59. # -------------------------------------------------------------------
  60.  
  61. touched:
  62.  
  63.     player = GetSourceRef();
  64.  
  65.     if (GetInv(player, bin) < GetInvMax(player, bin))
  66.     {
  67.         TakeItem(GetSenderRef(), player);
  68.     }
  69.     else
  70.     {
  71.         EndCutscene();
  72.     }
  73.     
  74.     return;
  75.  
  76. # -------------------------------------------------------------------
  77.  
  78. taken:
  79.  
  80.     player = GetSourceRef();
  81.  
  82.     ChangeInv(player, bin, 1.0);
  83.     SetInvAvailable(player, bin, 1);
  84.     JonesInvItemChanged(bin);
  85.  
  86.     Sleep(1.0);
  87.  
  88.     if (!bUnderwater)
  89.         PlayVoice(player, foundSnd, 1.0, 0);
  90.  
  91.     EndCutscene();
  92.  
  93.     return;
  94.  
  95. # -------------------------------------------------------------------
  96.  
  97. user0:
  98.  
  99.     player = GetLocalPlayerThing();
  100.  
  101.     if (GetInv(player, bin) > 0)
  102.     {
  103.         if (GetHealth(player) < 1000)
  104.         {
  105.             # Clear the poisoned bit
  106.             ClearActorFlags(player, 0x2000);
  107.  
  108.             # Use the kit
  109.             ChangeInv(player, bin, -1);
  110.             
  111.             if (GetInv(player, bin) == 0)
  112.             {
  113.                 SetInvAvailable(player, bin, 0);
  114.             }
  115.         }
  116.     }
  117.     
  118.     return;
  119.  
  120. end
  121.